﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace zUfDsl
{
    class cStart
    {
        #region 用于判断DLL的版本号
        public string getVersion()
        {
            return cHandleUF.cVerion.ToString("yyyy-MM-dd");
        }
        #endregion

        #region 提供调用的接口
        /// <summary>
        /// 提供调用的接口
        /// </summary>
        /// <param name="ctitle"></param>
        /// <param name="cuserid"></param>
        /// <param name="cusername"></param>
        /// <param name="cconnect"></param>
        /// <param name="curdate"></param>
        /// <param name="caccid"></param>
        /// <returns></returns>
        public System.Windows.Forms.Control getContrl(string ctitle, string cuserid, string cusername,
            string cconnect, DateTime curdate, string caccid)
        {
            try
            {
                cHandleUF.cUserID = cuserid;
                cHandleUF.cUserName = cusername;
                //MessageBox.Show(cconnect);
                cHandleUF.cConnstr = cconnect;
                if (!cHandleUF.cConnstr.Contains("Connect Timeout"))
                {
                    cHandleUF.cConnstr += $";Connect Timeout=0";
                }
                cHandleUF.dLoginDate = curdate;
                cHandleUF.cAccID = caccid;
                switch (ctitle)
                {
                    case "档案下发":
                        return new Sync.SyncData();
                    default:
                        MessageBox.Show(ctitle);
                        return null;
                }
            }
            catch (Exception ex)
            { Common.HandleException.Show(ex); return null; }
            
        }
        #endregion
    }
}
